package com.accounting.client.remote;

import com.accounting.client.remote.obj.Product;
import com.accounting.client.remote.obj.PurchaseRecord;
import com.accounting.client.remote.obj.Stock;
import com.accounting.client.remote.transfer.AddProductRequest;
import com.accounting.client.remote.transfer.CreatePurchaseRecordRequest;
import com.accounting.client.remote.transfer.DecreaseStocksRequest;
import com.accounting.client.remote.transfer.SearchPurchaseRecordRequest;
import com.accounting.client.remote.transfer.SearchStockRequest;
import com.accounting.client.remote.transfer.TransferPurchaseRecordRequest;
import com.accounting.client.remote.transfer.UpdateProductRequest;
import com.accounting.client.remote.transfer.UpdatePurchaseRecordRequest;

import corelib.client.jsonrpc.RemoteJSONService;
import corelib.client.search.PagingRequest;
import corelib.client.search.PagingResult;

public interface ProductService extends RemoteJSONService {
	
	public PagingResult<Product> ListProducts(String passport, int catId, PagingRequest request);
	public PagingResult<Product> ListProductsByKeyword(String passport, PagingRequest request);
	
	public boolean DeleteProduct(String passport, String productId);
	public boolean AddProduct(String passport, AddProductRequest request);
	public boolean UpdateProduct(String passport, String productId, UpdateProductRequest request);
	public boolean SyncProductStock(String passport, String productId);
	public PagingResult<Product> SearchProducts(String passport, PagingRequest request);
	
	public String  CreatePurchaseRecord(String passport,   CreatePurchaseRecordRequest request);
	public String  TransferPurchaseRecord(String passport, TransferPurchaseRecordRequest request);
	public boolean UpdatePurchaseRecord(String passport,   UpdatePurchaseRecordRequest request);
	public boolean DeletePurchaseRecord(String passport,   String recordId);
	public PagingResult<PurchaseRecord> ListPurchaseRecords(String passport, String productId, PagingRequest request);
	public PagingResult<PurchaseRecord> SearchPurchaseRecords(String passport, SearchPurchaseRecordRequest request);
	
	public boolean DecreaseStocks(String passport, DecreaseStocksRequest request);
	
	public PagingResult<Stock> ListStocks(String passport, PagingRequest request);
	public PagingResult<Stock> ListStocksByLocation(String passport, int location, PagingRequest request);
	public PagingResult<Stock> SearchStocks(String passport, SearchStockRequest request);
	public boolean SyncStock(String passport, String productId, int location);
}
